#include "downloadnewfiledialog.h"
#include "ui_downloadnewfiledialog.h"
#include "downloadobject.h"

DownloadNewFileDialog::DownloadNewFileDialog(QWidget *parent)
    : DownloadMoveDialogAbstract(parent),
    ui(new Ui::DownloadNewFileDialog)
{
    ui->setupUi(this);
    ui->closeButton->setIcon(QIcon(QPixmap(":/image/windowClose2")));
    ui->closeButton->setIconSize(QSize(25,25));
    ui->closeButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->closeButton->setToolTip(tr("Close"));
    ui->closeButton->setStyleSheet(DownloadObject::QToolButtonStyle2);
    ui->confirmButton->setCursor(QCursor(Qt::PointingHandCursor));
    ui->confirmButton->setStyleSheet(DownloadObject::QPushButtonStyle);

    connect(ui->closeButton,SIGNAL(clicked()),SLOT(close()));
    connect(ui->confirmButton,SIGNAL(clicked()),SLOT(confirmButtonPressed()));

}

DownloadNewFileDialog::~DownloadNewFileDialog()
{
    delete ui;
}

void DownloadNewFileDialog::confirmButtonPressed()
{
    QStringList urls = ui->urlTextEdit->toPlainText().split(';');
    emit setDownloadPath(urls);
    close();
}
